#!/usr/bin/env python

def gen_humble(n):
    factors = [7, 5, 3, 2]
    cnt = 1
    num = 8
    while cnt < n:
        tmp = num
        for factor in factors:
            while tmp % factor == 0:
                tmp /= factor
        if tmp == 1:
            factors.insert(0, num)
            print num
            cnt += 1
        num += 1
    return [1] + factors[:]
print gen_humble(5842)



